﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="OpenDocument.aspx.cs" Inherits="DuanDispatch_OpenDocument" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
        <link href="../css/style.css" rel="stylesheet" type="text/css" />
    <link type="text/css" rel="Stylesheet" href="../css/custom-theme/jquery-ui-1.8.5.custom.css" />
    <script type="text/javascript" src="../Js/CheckData.Js"></script>
    <script type="text/javascript" src="../Js/Common.Js"></script>
    <script type="text/javascript" src="../Js/ntko.js"></script>
    <script type="text/javascript" src="../Js/jquery-1.4.3.min.js"></script>
    <script type="text/javascript" src="../Js/jquery-ui-1.8.5.custom.min.js"></script>
            <script type="text/javascript">
                window.onload = function () {
                    TANGER_OCX_OBJ = document.getElementById("TANGER_OCX");
                    TANGER_OCX_OBJ.Menubar = true;
                    openTemplateFileFromUrl('<%=filePath %>');
                    TANGER_OCX_OBJ.ToolBars = true;
                    TANGER_OCX_OBJ.SetReadOnly(true);

                };
 
    </script>
</head>
<body>
    <form id="form1" runat="server">
   <div align="center">
        <div id="officecontrol" style="width: 90%; height: 880px; margin-top: 10px;">
            <!--引用NTKO OFFICE文档控件-->
            <script language="javascript" type="text/javascript" src="../Js/ntkoofficecontrol_standard.js"></script>
            <!--控件事件代码开始-->
            <script type="text/javascript" language="JScript" for="TANGER_OCX" event="OnFileCommand(cmd,canceled);">
	                alert(cmd);
	                CancelLastCommand=true;
            </script>
            <script type="text/javascript" language="JScript" for="TANGER_OCX" event="OnDocumentClosed();">
	                setFileOpenedOrClosed(false);
            </script>
            <script type="text/javascript" language="JScript" for="TANGER_OCX" event="OnDocumentOpened(TANGER_OCX_str,TANGER_OCX_obj);">
	                //saved属性用来判断文档是否被修改过,文档打开的时候设置成ture,当文档被修改,自动被设置为false,该属性由office提供.	                
	                TANGER_OCX_OBJ.ActiveDocument.Saved = true;
	                setFileOpenedOrClosed(true);//设置文档状态值
		            //controlStyle();//插入控件样式自定义菜单
		            //SetReviewMode(true);//设置文档在痕迹模式下编辑
            </script>
            <script type="text/javascript" language="JScript" for="TANGER_OCX" event="OnFileCommand(TANGER_OCX_str,TANGER_OCX_obj);">
	                if (TANGER_OCX_str == 3) 
	                {
		                alert("不能保存！");
		                CancelLastCommand = true;
	                }
            </script>
            <script language="JScript" for="TANGER_OCX" event="OnCustomMenuCmd2(menuPos,submenuPos,subsubmenuPos,menuCaption,menuID)">
		            //alert("第" + menuPos +","+ submenuPos +","+ subsubmenuPos +"个菜单项,menuID="+menuID+",菜单标题为\""+menuCaption+"\"的命令被执行.");
		            if("全网页查看"==menuCaption)objside();
		            if("恢复原大小"==menuCaption)objside2();
            </script>
            <script type="text/javascript" language="JScript" for="TANGER_OCX" event="AfterPublishAsPDFToURL(result,code);">
	                result=trim(result);
	                alert(result);
	                if(result=="succeed")
	                {window.close();}
                    
            </script>
        </div>
    </div>

    </form>
</body>
</html>
